package com.ruoyi.erp.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.erp.mapper.BusinessUnitDepartmentMapper;
import com.ruoyi.erp.domain.BusinessUnitDepartment;
import com.ruoyi.erp.service.IBusinessUnitDepartmentService;
import com.ruoyi.common.core.text.Convert;

/**
 * 成本中心Service业务层处理
 * 
 * @author sauger
 * @date 2022-04-03
 */
@Service
public class BusinessUnitDepartmentServiceImpl implements IBusinessUnitDepartmentService 
{
    @Autowired
    private BusinessUnitDepartmentMapper businessUnitDepartmentMapper;

    /**
     * 查询成本中心
     * 
     * @param id 成本中心主键
     * @return 成本中心
     */
    @Override
    public BusinessUnitDepartment selectBusinessUnitDepartmentById(Integer id)
    {
        return businessUnitDepartmentMapper.selectBusinessUnitDepartmentById(id);
    }

    /**
     * 查询成本中心列表
     * 
     * @param businessUnitDepartment 成本中心
     * @return 成本中心
     */
    @Override
    public List<BusinessUnitDepartment> selectBusinessUnitDepartmentList(BusinessUnitDepartment businessUnitDepartment)
    {
        return businessUnitDepartmentMapper.selectBusinessUnitDepartmentList(businessUnitDepartment);
    }

    /**
     * 新增成本中心
     * 
     * @param businessUnitDepartment 成本中心
     * @return 结果
     */
    @Override
    public int insertBusinessUnitDepartment(BusinessUnitDepartment businessUnitDepartment)
    {
        return businessUnitDepartmentMapper.insertBusinessUnitDepartment(businessUnitDepartment);
    }

    /**
     * 修改成本中心
     * 
     * @param businessUnitDepartment 成本中心
     * @return 结果
     */
    @Override
    public int updateBusinessUnitDepartment(BusinessUnitDepartment businessUnitDepartment)
    {
        return businessUnitDepartmentMapper.updateBusinessUnitDepartment(businessUnitDepartment);
    }

    /**
     * 批量删除成本中心
     * 
     * @param ids 需要删除的成本中心主键
     * @return 结果
     */
    @Override
    public int deleteBusinessUnitDepartmentByIds(String ids)
    {
        return businessUnitDepartmentMapper.deleteBusinessUnitDepartmentByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除成本中心信息
     * 
     * @param id 成本中心主键
     * @return 结果
     */
    @Override
    public int deleteBusinessUnitDepartmentById(Integer id)
    {
        return businessUnitDepartmentMapper.deleteBusinessUnitDepartmentById(id);
    }
}
